Skip to content

refactor: deepen news sources, brand identity, and styles - #158

Open
ronaldtse wants to merge 2 commits into
mainfrom
refactor/deepen-news-identity
Open

refactor: deepen news sources, brand identity, and styles#158
ronaldtse wants to merge 2 commits into
mainfrom
refactor/deepen-news-identity

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

What

Implements all five deepening candidates from the architecture review. No page changes visually; this is a structure-only refactor.

1. Article is the news seam

  • New hub/src/lib/article.ts — the deep Article interface + NewsSource seam. Every source projects onto it.
  • hub/src/lib/sources/{wireSource,spokeSource,postSource}.ts — one adapter per source.
  • hub/src/lib/newsIndex.ts — composes sources; exports allArticles, newsStreamArticles, byKind, byHref, articleKind.
  • pages/news/[...slug].astro (128 → 66 lines), pages/news/index.astro (rewritten with search + kind/year filter bar on one data source), homepage Latest, and all four feed endpoints now consume newsIndex / newsStream instead of importing readers directly.
  • Adding a new spoke = one adapter entry; no page changes.

2. One brand identity module

  • hub/src/lib/identity.tsBrandMark type + resolvers: suiteMark, platformMark, productMarkFor, clientMark (with verified lightInk/large treatments).
  • hub/src/components/BrandMark.astro — the single renderer: light/dark pair, darkMono invert, ink chip for white artwork, letter-tile fallback.
  • All nine consumers migrated (ClientWall, customers, SuiteCard, PlatformCard, platforms/[id], technologies/[id], technologies/index, index, news chips).

3. Styles split

  • tokens.css (fonts, palette, base) / components.css (reusable classes) / pages.css (article chrome, print, hero, filters); global.css is the composition root. Deduped the double .news-filter-chip definition.

4. News cards merged

  • NewsCard.astro had zero consumers; both listing pages render Article inline. Deleted the dead component and the dead news/[...id].astro stub (it generated zero pages).

5. One cache-first fetcher

  • hub/src/lib/cachedFetch.ts — used by spokeSource and HttpWireReader (its private duplicate removed).

Removed (superseded, all revamp-authored)

lib/newsmlSpoke.ts, lib/logoTreatment.ts, lib/productIdentity.ts, components/{LogoFigure,SuiteLogo,PlatformLogo,NewsCard}.astro, pages/news/[...id].astro.

Verified

  • Full build passes: 225 stream articles (137 ribose.com, 84 Metanorma, 4 PubID), 318 news paths (incl. legacy redirect stubs), archived platform pages render with the archive notice.
  • Feeds: newsml.xml and feed.xml well-formed; feed.json 225 ninjs items.
  • All mark variants rendered and checked in dist: dark pairs (expresslang), ink chip (NGI), suite/platform symbols (RNP), product chips on /news.
  • Known upstream gap (not this PR): metanorma.org 404s on 2019-10-08-metanorma-accessibility-html-word and 2019-08-25-notes-examples-iso newsml files — hub skips them with a warning; needs a spoke-side fix.

- Article interface (lib/article.ts) as the single news seam; wire,
  spoke, and post adapters (lib/sources/) project onto it, and
  newsIndex composes them — pages and feeds no longer import raw readers
- lib/identity.ts consolidates suite/platform/product/client marks;
  BrandMark.astro is the one renderer for all of them
- lib/cachedFetch.ts is the single cache-first fetcher (spoke + wire)
- global.css split into tokens/components/pages with global.css as
  composition root; deduped .news-filter-chip
- removed the superseded modules: newsmlSpoke, logoTreatment,
  productIdentity, LogoFigure, SuiteLogo, PlatformLogo, NewsCard,
  news/[...id].astro stub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant